﻿// // ******************************************************************
// //       /\ /|       @file       CultureDto.cs
// //       \ V/        @brief      await29
// //       | "")       @author     Await, 285283010@qq.com
// //       /  |
// //      /  \\        @Modified   2024-12-15 09:12
// //    *(__\_\        @Copyright  Copyright (c) , 2024-12-15 09:12 Await
// // ******************************************************************

namespace AutomaticSubtitles.Contracts.Config;

public class CultureDto
{
    /// <summary>
    /// 语言文化。
    /// </summary>
    public CultureDto(string name, string displayName, string twoLetterISOLanguageName, IReadOnlyList<string> threeLetterISOLanguageNames)
    {
        Name = name;
        DisplayName = displayName;
        TwoLetterISOLanguageName = twoLetterISOLanguageName;
        ThreeLetterISOLanguageNames = threeLetterISOLanguageNames;
    }

    /// <summary>
    /// 获取名称.
    /// </summary>
    /// <value>名字.</value>
    public string Name { get; }

    /// <summary>
    /// 获取显示名称.
    /// </summary>
    /// <value>显示名称.</value>
    public string DisplayName { get; }

    /// <summary>
    /// 获取双字母ISO语言的名称.
    /// </summary>
    /// <value>双字母ISO语言的名称.</value>
    public string TwoLetterISOLanguageName { get; }

    /// <summary>
    /// 获取三个字母的ISO语言的名称.
    /// </summary>
    /// <value>三字母ISO语言的名称.</value>
    public string? ThreeLetterISOLanguageName
    {
        get
        {
            var vals = ThreeLetterISOLanguageNames;
            if (vals.Count > 0) return vals[0];

            return null;
        }
    }

    public IReadOnlyList<string> ThreeLetterISOLanguageNames { get; }
}